package thread;

public class ThreadLocalTest {
    public static void main(String[] args) {
        Runnable thread = () -> {
            ThreadLocalUtil.set("name", Thread.currentThread().getName());

            for (int j = 0; j < 2000; j++) {
                System.out.println(Thread.currentThread().getName() + "---" + j + "---" + ThreadLocalUtil.get("name"));
            }
        };
        for (int i = 0; i < 2; i++) {
            new Thread(thread).start();
        }
    }
}
